UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0igsQWl77S0tcwYLKOEmZtpxkbaQCvCpW7pmO8kNWRs='
WHERE
key_id = 'e9c90fcf8f741a54ba2469d4c78389a41289881102107662d01617a15915a282'
AND (
token = '0igsQWl77S0tcwYLKOEmZtpxkbaQCvCpW7pmO8kNWRs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)