UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9gOvaGVVIfSj/h+NP3CreLRUvG52A2+AADg6byqIE0Q='
WHERE
key_id = '35025f11d653b5e100f51bba63c97874f446cae68f7dcd717c4bb5dfe9a8eff8'
AND (
token = '9gOvaGVVIfSj/h+NP3CreLRUvG52A2+AADg6byqIE0Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)