UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/iygoqRKJKXicGWOTjvOai49K1XaEZZUKdKZu3/NW0o=' 
WHERE 
  key_id = 'f8d410746ebf557c57cefd7c178525e7ea6f737c114573dd3afb5bea919c5133' 
  AND (
    token = '/iygoqRKJKXicGWOTjvOai49K1XaEZZUKdKZu3/NW0o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022