UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'P4RkQxiH2k/Lvf4TDCkrzILTXSWOwBioD0Jwd4fmXNY='
WHERE
key_id = '7bfd1cda439ff7ec819b59e9edccfc13dc9d32bcf60fff589dec1788d67ca814'
AND (
token = 'P4RkQxiH2k/Lvf4TDCkrzILTXSWOwBioD0Jwd4fmXNY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)