UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'd8ugOU9zV0ytoFEOvWelWGeP90vSBScpQky744oQwug=' 
WHERE 
  key_id = '68bd536e5cca386fc3f30127ab0d4957b4ebc3d9fc803a1b5391d26002d35139' 
  AND (
    token = 'd8ugOU9zV0ytoFEOvWelWGeP90vSBScpQky744oQwug=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049