UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YLcfTFbgCUz6+dP3uVvVfoMShWOAghpBsUFNWEKsjuQ='
WHERE
key_id = '384b37cd5b072a2521ec3d3784cb7f7fcdc87f5e1908e0d2a208d4f26582c0c0'
AND (
token = 'YLcfTFbgCUz6+dP3uVvVfoMShWOAghpBsUFNWEKsjuQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)