UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '20XUf4125UmNsz79bdt8VN1yqTrlGpNcmOjZCU3+fPE='
WHERE
key_id = '2625c321a8a0cdf56a195bfec70b49b06b79bba6c621048a3873fe9a783d1818'
AND (
token = '20XUf4125UmNsz79bdt8VN1yqTrlGpNcmOjZCU3+fPE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)