UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZZc7Fed7Y6qaDJBknt3SMgAzZaUGqbq0e+PgzrWUPWM='
WHERE
key_id = '9e87199627f605874864f82c972fab701edc4546bbd3894957300b037a8c6166'
AND (
token = 'ZZc7Fed7Y6qaDJBknt3SMgAzZaUGqbq0e+PgzrWUPWM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)