UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LI/Q/BoBzF+PW+rFvspK2UFJ8NAGRPpu7e9EDgektD0='
WHERE
key_id = 'bf3630293dcece45db2dba18c8f964e8d51ca6ee5951a3e799e3cf3c06431b33'
AND (
token = 'LI/Q/BoBzF+PW+rFvspK2UFJ8NAGRPpu7e9EDgektD0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)