UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZRPVIukUVWfFStNRVIt4CgkRiNVMO+Jlvl02sfdKsu4='
WHERE
key_id = '3f45f671a44c4ec1e2e9c70260d6f01661d327c5ca2344cf2c555ac469850139'
AND (
token = 'ZRPVIukUVWfFStNRVIt4CgkRiNVMO+Jlvl02sfdKsu4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)