UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OUZ6rAuKJ70vvHbPRkFSND9hNGSV1zNc0TROKR9joQM='
WHERE
key_id = '8ba9ad730b54bba5b3cae1ad1f361702208ff3f1b6821b94ec87b3ac74ca65f5'
AND (
token = 'OUZ6rAuKJ70vvHbPRkFSND9hNGSV1zNc0TROKR9joQM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)