UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kiah8Wf3yb1vWdF3U6anFjJIDuceYAScfOJFYkCbZ6A=' 
WHERE 
  key_id = '8955717f3eb52de25ba5ff54476a345e1d120575fbf7e7d1f8d45d5faf268097' 
  AND (
    token = 'kiah8Wf3yb1vWdF3U6anFjJIDuceYAScfOJFYkCbZ6A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025