UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FhwO3gRYpkSBj8gO0ejBoaL7UycWfIXDo7e9eVjMVmg='
WHERE
key_id = '3272cc86d167ca99b56b1fbacf1933b73f12d12ae8362c9a6ce5d17445289429'
AND (
token = 'FhwO3gRYpkSBj8gO0ejBoaL7UycWfIXDo7e9eVjMVmg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)