UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V8UgUia1I5awmZO/NI6LW8nDZKN1voEC9vZ3PeIixZs='
WHERE
key_id = 'a49fb80304cef4c56570ebcd4eb887c3739f330f1a53afc378ff0111daf2b8f0'
AND (
token = 'V8UgUia1I5awmZO/NI6LW8nDZKN1voEC9vZ3PeIixZs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)