UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 300, 
  token = '/tdA8jT99W7rvj11ovw+I/8g4X2ojgV6HL5nvi92JgE=' 
WHERE 
  key_id = 'c3648d4158f6acb6357c270a011ec1c9371a71c26e5bb4df7d558bb627c845f8' 
  AND (
    token = '/tdA8jT99W7rvj11ovw+I/8g4X2ojgV6HL5nvi92JgE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016