UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nUU03RGx/qFypLp00K9mQ1zQI79dgHGqegkEjWQF0fs='
WHERE
key_id = 'b26d1ad7f0527227a916d258a7f8b4058d971ed2de314b3b11eefa3185e5deb3'
AND (
token = 'nUU03RGx/qFypLp00K9mQ1zQI79dgHGqegkEjWQF0fs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)