UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Zf2JsT1d6XPPXsK4EgOsEmoXYJ7QILAb0lJE4YdKDvw='
WHERE
key_id = '364c3635bc00c93d7e96c1d7206e2ff0324e15117b7e827e7579443ca1ee1b1e'
AND (
token = 'Zf2JsT1d6XPPXsK4EgOsEmoXYJ7QILAb0lJE4YdKDvw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)