UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fg4AjzWncGGo9ApvvHyKVaj6ElbX6QK7nYHhJZpr/EM=' 
WHERE 
  key_id = '2ab4a8f1563ffc1ad6f0ca0a838ad39e58fa03760634cf3e9fd84c020a1da56b' 
  AND (
    token = 'fg4AjzWncGGo9ApvvHyKVaj6ElbX6QK7nYHhJZpr/EM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029