UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8tgtW8t5jloBc1/DfCSlJgVJi7YwGkGPpySr2Knn+bc='
WHERE
key_id = 'a4ff472e96d9d6e918341d8c03c1d31ae6bbb036824dafa88e9f28bb30eb5863'
AND (
token = '8tgtW8t5jloBc1/DfCSlJgVJi7YwGkGPpySr2Knn+bc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)