UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'txp0stjgm60absGHOz4FgkvzccpfGyyRAlFTw7GTxaU=' 
WHERE 
  key_id = '8d32441a7eb0b05edbf07eea63168c4cb1dff86fbdf8e3cb4905c22c5b6265da' 
  AND (
    token = 'txp0stjgm60absGHOz4FgkvzccpfGyyRAlFTw7GTxaU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040