UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XT1MjoRR1A8GCHitq1uQjbJqEWmIzB8/kU7c6TBQpKo=' 
WHERE 
  key_id = '0a94ebb8c61c046f88dd8122352ac11a6df7659d4dcc30e8ffa04c888b48771a' 
  AND (
    token = 'XT1MjoRR1A8GCHitq1uQjbJqEWmIzB8/kU7c6TBQpKo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038