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