UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iF7UgQSA7cROx1CvCo3W/zA7asHIkWSTGXAWe1VoOEM='
WHERE
key_id = '10b28f24e181c06230d427fd054e4bd24a4a4d3f05023f92439a60e2a35819dc'
AND (
token = 'iF7UgQSA7cROx1CvCo3W/zA7asHIkWSTGXAWe1VoOEM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)