UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Yj5PmBM1Yl+XAWc9WgAzsETMJM92znNiGzIKPiW3nuc='
WHERE
key_id = '5036823090682ac0eaad2e284bf68480d397bf76c2c0c2c5eac8c05f2272b119'
AND (
token = 'Yj5PmBM1Yl+XAWc9WgAzsETMJM92znNiGzIKPiW3nuc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)