UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JHyQ22b2JeRDeMqrOSuT+cemvjgjheFg3HBKZEsNv/o='
WHERE
key_id = '302fbc3a4df2e1ebcb1cb5f9a211902d3e8e6f2f0ad8ff868f816953fe8fdeff'
AND (
token = 'JHyQ22b2JeRDeMqrOSuT+cemvjgjheFg3HBKZEsNv/o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)