UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hR2hj7DqXGWu72M8p8YY/pi1nn5beUW0uAahTcOCvkE='
WHERE
key_id = '044b92007efb4dc8851e7f6755d7573d531b4ff3274b02b1bff8b2e4dc8db690'
AND (
token = 'hR2hj7DqXGWu72M8p8YY/pi1nn5beUW0uAahTcOCvkE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)