UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LELsryjV7vwRCE1b8PJJkqcy7jzaogmhTGfXtdpJiZQ=' 
WHERE 
  key_id = 'b59ba83a4e784d2ae24fb204337da95d5b6140e5e92a785c4c0015f12638c58b' 
  AND (
    token = 'LELsryjV7vwRCE1b8PJJkqcy7jzaogmhTGfXtdpJiZQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050