UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZMZ5rbnpfrvfAmnTst3rCgtS8uMN17ASv36Ua5qI/ZY='
WHERE
key_id = 'e24636d2d9f8a7e6b6a3dd077c51729e3e98e8fffcaba960b7e49313ab31ae84'
AND (
token = 'ZMZ5rbnpfrvfAmnTst3rCgtS8uMN17ASv36Ua5qI/ZY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)