UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'khGudzidyP7CgIDCqqRVSBTjFG79rjsf08eIk7AY1sQ='
WHERE
key_id = 'ac65be85d777b6ae3320ae13dea473a92fc10f303a859326ba901447eeedbd12'
AND (
token = 'khGudzidyP7CgIDCqqRVSBTjFG79rjsf08eIk7AY1sQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)