UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'skqJUJGF/u2IKTxylNxa11L8HFuhfLuFe3XYf2BdaN8='
WHERE
key_id = '4c8963d7c1cf01c1ffd46bfedbaf70915c7a276a491f0acb81c9fe26f005f367'
AND (
token = 'skqJUJGF/u2IKTxylNxa11L8HFuhfLuFe3XYf2BdaN8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)