UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Yphbx74dak0WVjMUNtKFQfGQkZTpr/LSXv2F666Y5zM='
WHERE
key_id = '03b66e81350f63879a9eecfc4b515ad16825207ac5b01c7999041b56293dd184'
AND (
token = 'Yphbx74dak0WVjMUNtKFQfGQkZTpr/LSXv2F666Y5zM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)