UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ybo3EvFdflkNuCNuDHQRpguuyuQk8wfrLl+aTM9W368='
WHERE
key_id = 'ff37519d122d59f84de03edcb1b50b9bcb40b1d388f5b1a81b59e8fafa9ee22c'
AND (
token = 'ybo3EvFdflkNuCNuDHQRpguuyuQk8wfrLl+aTM9W368='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)