UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zTeeYe44oFOUUlRkN/gZUROeDGYwSdD7UbmmPDUXL44=' 
WHERE 
  key_id = '029fc59dfca286e594b8e1842b33574d9ba4551924609e79d535fa0db9d3dd2b' 
  AND (
    token = 'zTeeYe44oFOUUlRkN/gZUROeDGYwSdD7UbmmPDUXL44=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044