UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JR/WwthOlLLO5lkTtesYPTmSKjYxrWhmuywC7xK6g6w='
WHERE
key_id = '751bc52ebff7c399f083760d12ad9cd851878aa68c052da0ad5dd1fe6ba8bd37'
AND (
token = 'JR/WwthOlLLO5lkTtesYPTmSKjYxrWhmuywC7xK6g6w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)