UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'L2RTnbY/1+q68PeoaC9UwGPo3oBpKWXYjZrfrgZPfvU='
WHERE
key_id = '86ca512f67ddf4e380c96f86008bf3963fef46696f0438238c93a90e7f9e5bcc'
AND (
token = 'L2RTnbY/1+q68PeoaC9UwGPo3oBpKWXYjZrfrgZPfvU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)