UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8Lg3motOmE63zWjQwep7JI9G3BoW4GnWNGsloKoElAs='
WHERE
key_id = '626efa93b5e090bff65f813b34274615fc17f30d5930c9be22e3466c39091ee7'
AND (
token = '8Lg3motOmE63zWjQwep7JI9G3BoW4GnWNGsloKoElAs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)