UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5QVEtY7zVDcwIKybn/HyMf0hM/ZHyE71Hx8Fss59GYg='
WHERE
key_id = 'f7e8d10c01129ec73fae32b913f1d3e0cd27cededc2acf5686fe20dc88074d97'
AND (
token = '5QVEtY7zVDcwIKybn/HyMf0hM/ZHyE71Hx8Fss59GYg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)