UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PWLZWP1eDY7jPD9URPUZ2UYvXLTj8DRmrklvw+XPvGw=' 
WHERE 
  key_id = '923bb441435d10e10eedad19c78de92ad05365c472f08758db55320e21149ef3' 
  AND (
    token = 'PWLZWP1eDY7jPD9URPUZ2UYvXLTj8DRmrklvw+XPvGw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00064