UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qhQMx/tFOBmR5QSvr6fnJFU1i1na3zCe6+bjgDSwdMM=' 
WHERE 
  key_id = 'c6a08485e4bb820d108f1b5a95b4c55143dda5e320f60a041cfb105c6052ee93' 
  AND (
    token = 'qhQMx/tFOBmR5QSvr6fnJFU1i1na3zCe6+bjgDSwdMM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028