UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2JGCSfMrybLSRzPSCU7FANryYbljuit61Qia7a49gwo=' 
WHERE 
  key_id = '1978a30b5637243defd8d5c69410743346c42afc0cc69da46e32e386d146395a' 
  AND (
    token = '2JGCSfMrybLSRzPSCU7FANryYbljuit61Qia7a49gwo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035