UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9dEEB37cH5ptvlIBYtnjdyb91ICW2MzDNo0l1lqDK6E=' 
WHERE 
  key_id = '55ec0e2440b311e1214799d26384251bc5c2f384b77ad96985e93edf9ab400af' 
  AND (
    token = '9dEEB37cH5ptvlIBYtnjdyb91ICW2MzDNo0l1lqDK6E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028