UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gBJM+wF+LbDP9nD+0CrLqsZQllbMrrS27gJbZHS9EJk=' 
WHERE 
  key_id = 'dfaed53b1dcf2b547ad4c25e9968d9ab79b7ea7d18f6b1dadcd949bf21c520fe' 
  AND (
    token = 'gBJM+wF+LbDP9nD+0CrLqsZQllbMrrS27gJbZHS9EJk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032