UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lfXRjSn7meifYDFaBYXezQeEZLTaVRHU2DlLg90nGBU='
WHERE
key_id = 'ecd711745aa90a7fb3bbb706165c0ff56fd12d8b05efacebbd2d93db541bc822'
AND (
token = 'lfXRjSn7meifYDFaBYXezQeEZLTaVRHU2DlLg90nGBU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)