UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qBNTOB5nExwPX6MwTwCLmDa/o8cR/3krI/RW9mRMpyk='
WHERE
key_id = 'dd9024935eca87e41897f1368cba6c52c0ab4910987123abda40b6a41cb35d96'
AND (
token = 'qBNTOB5nExwPX6MwTwCLmDa/o8cR/3krI/RW9mRMpyk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)