UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Jz7CkmXiJmYNoToDg9bFVqM5L6bpkZSUlBUXBkMZv1c='
WHERE
key_id = '24f4128be1bcaebc4ebef6c81cbef2de4f760f76af489fad256bd72909afe15a'
AND (
token = 'Jz7CkmXiJmYNoToDg9bFVqM5L6bpkZSUlBUXBkMZv1c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)