UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'i9ooS2kLMOO70hQB8ocRAvefIJI9lTYDsIIPPYtf8N8='
WHERE
key_id = 'b2c3592ab2b8fbc24625fbcc2ecb40e921d47eec0c9e3908ce067d73361f0bd2'
AND (
token = 'i9ooS2kLMOO70hQB8ocRAvefIJI9lTYDsIIPPYtf8N8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)